#include <iostream>
#include <termio.h>
#include <stdio.h>
using namespace std;

#define QUESTION "Do you want another transaction"
int tty_mode(int how){
    static struct termios orginal_mode;
    if(how == 0){
        tcgetattr(0,&orginal_mode);
    }
    else {
        return tcsetattr(0,TCSANOW,&orginal_mode);
    }
}

void set_crmode(){
        struct termios ttystat;
        tcgetattr(0,&ttystat);
        ttystat.c_lflag &= ~ICANON;  //
        ttystat.c_cc[VMIN] = 1;
        tcsetattr(0,TCSANOW,&ttystat);
}

int main()
{
    int r;
    tty_mode(0);
    set_crmode();
    int c;
    while(c = getchar()){
        putchar(c);
        putchar('\n');

    }
    tty_mode(1);
    return 0;
}

